﻿//begin va
var obj;
var sIdTS, sNameTS, sPathTS;
var arItemTS = new Array()
var sLink = '0.xml';

var FolderId = RelatedFolder;
var DelayId;
var t, t1, t2;
var MNSStemp = 'MNSS1';
var indexPicItem = 0;
var maxindexPicItem = 0;
var arrItempic = new Array();
var autochangepic;
var rightOpacity1 = 1;
var rightOpacity2 = 100;
var flagOtherFolder = true;
var sLoDID = ',', sDate = '';
var strLinkImg = "http://sohoa.vnexpress.net/images/menu/menu1000.gif";

//end var

function changeSearch(id) {
    document.getElementById(MNSStemp).style.fontWeight = 'normal';
    document.getElementById(id).style.fontWeight = 'bold';
    MNSStemp = id;
    document.getElementById('MNSubSearch').style.display = 'none';
}
function setDelayHiddenDiv(div, time) {
    if (t2 != null) {
        clearTimeout(t2);
        t2 = setTimeout('hiddenDiv("' + div + '")', time);
    }
    else
        t2 = setTimeout('hiddenDiv("' + div + '")', time);
}
function hiddenDiv(div) {

    document.getElementById(div).style.display = 'none';
}
function displayDiv(div) {
    document.getElementById(div).style.display = 'block';
}
function createHTML2(arItemTS, div1, div2, div3) {
    document.getElementById(div1).innerHTML = '<img src="' + arItemTS[0][1] + arItemTS[0][4] + '" class="SHimg" alt="' + arItemTS[0][2] + '" onclick="location.href=\'' + arItemTS[0][1] + '\'" />';
    document.getElementById(div2).innerHTML = '<div onclick="location.href=\'' + arItemTS[0][1] + '\'" class="SH1">' + arItemTS[0][2] + '</div>' + '<div class="SH2">' + arItemTS[0][3] + '</div>';
    document.getElementById(div3).innerHTML = '<div onclick="location.href=\'' + arItemTS[1][1] + '\'" class="SH3"><div class="SH4"><img src="http://sohoa.vnexpress.net/images/newhome/nh9.gif" /></div>&nbsp;' + arItemTS[1][2] + '</div>' + '<div onclick="location.href=\'' + arItemTS[2][1] + '\'" class="SH5"><div class="SH4"><img src="http://sohoa.vnexpress.net/images/newhome/nh9.gif" /></div>&nbsp;' + arItemTS[2][2] + '</div>';
}



function setFolderDefault() {
    if (FolderId == 10000) {
        FolderId = 1;
        flagOtherFolder = false;
       
    } else if (FolderId != 2 && FolderId != 3 && FolderId != 4 && FolderId != 5 && FolderId != 6 && FolderId != 7 && FolderId != 8 && FolderId != 9) {
        FolderId = 1;
        flagOtherFolder = false;
    }
    document.getElementById(FolderId).className = 'menuActive' + FolderId + '_' + FolderId;
    writeSubmenu(FolderId);
}

function writeSubmenu(id) {
    //alert(id);

       if (id == 1) {
   //home
    document.getElementById("subMenu").innerHTML = "<div style='color:#848484;font-style:Arial;margin-top:-1px;'><img src='http://sohoa.vnexpress.net/images/menu/iconPhone.gif'  align=absmiddle' style='margin'/><a href='http://kontactr.com/user/xzipvn'>&nbsp;&nbsp; Liên hệ &nbsp;</a> <img src='http://sohoa.vnexpress.net/images/menu/iconMenu.gif' align='top'  style='margin' style='margin-top:-2px' /> <a href='http://feeds2.feedburner.com/xzipguide'>&nbsp;&nbsp;RSS Posts</a> <img src='http://i342.photobucket.com/albums/o433/bkprobk/rss-ico.gif' align='top'  style='margin' style='margin-top:-2px' /> <a href='http://www.xzipguide.blogspot.com/feeds/comments/default'>&nbsp;&nbsp; RSS Commet</a></div>";

    document.getElementById("subMenu").style.marginLeft = "-90px";
    DelayId = id;
    }

    else if (id == 2) {
//menu1
document.getElementById("subMenu").innerHTML = "<a class='aSubMenu' href='http://www.xzipguide.blogspot.com/search/label/Thu%20thuat%20Blog?max-results=10'>&nbsp;Blogspot&nbsp;&nbsp; </a> <img src='" + strLinkImg + "' /> <a class='aSubMenu' href='http://www.xzipguide.blogspot.com/search/label/Thu%20thuat%20may%20tinh?max-results=10'>&nbsp;&nbsp; Máy tính&nbsp;&nbsp;</a> <img src='" + strLinkImg + "' /> <a class='aSubMenu' href='http://xzipguide.blogspot.com/search/label/Thu%20thuat%20E-mail-Chat?max-results=10'>&nbsp;&nbsp;Email-Chat&nbsp;&nbsp;</a> <img src='" + strLinkImg + "' /><a class='aSubMenu' href='http://xzipguide.blogspot.com/search/label/Thu%20thuat%20Mobile?max-results=10'> &nbsp;&nbsp;Mobile</a>";
document.getElementById("subMenu").style.marginLeft = "-95px";
DelayId = id;
}

else if (id == 3) {
// menu2
document.getElementById("subMenu").innerHTML = "<a class='aSubMenu' href='http://www.google.com.vn/language_tools'>&nbsp;&nbsp; Từ điển&nbsp;&nbsp; </a> <img src='" + strLinkImg + "' /> <a class='aSubMenu' href='http://xzipvncode.co.cc/'>&nbsp;&nbsp;  Blogcrowds&nbsp;&nbsp; </a> <img src='" + strLinkImg + "' /> <a class='aSubMenu' href='http://code.vietwebguide.com/vietuni/vietuni.html'>&nbsp;&nbsp; Unikey&nbsp;&nbsp;</a> <img src='" + strLinkImg + "' /><a class='aSubMenu' href='http://mediafire.com'>&nbsp;&nbsp; Mediafire &nbsp;&nbsp;</a>";
document.getElementById("subMenu").style.marginLeft = "-60px";
DelayId = id;
}

else if (id == 4) {
//menu3
document.getElementById("subMenu").innerHTML = "<a class='aSubMenu' href='http://www.xzipguide.blogspot.com/search/label/Hoc%20Anh%20van?max-results=10'>&nbsp;&nbsp; Học Anh văn&nbsp;&nbsp; </a> <img src='" + strLinkImg + "' /> <a class='aSubMenu' href='http://www.xzipguide.blogspot.com/search/label/Khoa%20hoc?max-results=10'> &nbsp;&nbsp;Khoa học&nbsp;&nbsp; </a> <img src='" + strLinkImg + "' /> <a class='aSubMenu' href='http://www.xzipguide.blogspot.com/search/label/Kien thuc chung?max-results=10'>&nbsp;&nbsp; Kiến thức chung </a>";
document.getElementById("subMenu").style.marginLeft = "22px";
DelayId = id;
}

else if (id == 5) {
//menu4
document.getElementById("subMenu").innerHTML = "<a class='aSubMenu' href='http://xzipguide.blogspot.com/search/label/Software?max-results=10'>&nbsp;&nbsp;&nbsp; Software&nbsp;&nbsp;</a> <img src='" + strLinkImg + "' /> <a class='aSubMenu' href='http://www.xzipguide.blogspot.com/search/label/E-book?max-results=10'>&nbsp;&nbsp;&nbsp;E-books&nbsp;&nbsp;</a><img src='" + strLinkImg + "' /> <a class='aSubMenu' href='http://www.xzipguide.blogspot.com/search/label/Phim?max-results=10'>&nbsp;&nbsp;&nbsp;Kho phim&nbsp;&nbsp;</a> <img src='" + strLinkImg + "' /><a class='aSubMenu' href='http://xzipguide.blogspot.com/2009/10/kho-game-link-mediafire-91-game.html'>&nbsp;&nbsp;&nbsp;Game</a>";
document.getElementById("subMenu").style.marginLeft = "70px";
DelayId = id;
}


else if (id == 6) {
//menu5

document.getElementById("subMenu").innerHTML = "<a class='aSubMenu' href='http://xzipguide.blogspot.com/search/label/Wallpaperkool?max-results=10'>&nbsp;&nbsp;&nbsp;Wallpaperkool&nbsp;&nbsp;</a> <img src='" + strLinkImg + "' /> <a class='aSubMenu' href='http://www.xzipguide.blogspot.com/search/label/Avatar?max-results=10'>&nbsp;&nbsp;&nbsp;Avatar xinh&nbsp;&nbsp;</a> <img src='" + strLinkImg + "' /><a class='aSubMenu' href='http://xzipguide.blogspot.com/search/label/Anh%20doc?max-results=10'>&nbsp;&nbsp;&nbsp;Ảnh độc&nbsp;&nbsp;</a>";
document.getElementById("subMenu").style.marginLeft = "130px";
DelayId = id;
}


else if (id == 7) {
//menu6

document.getElementById("subMenu").innerHTML = "<a class='aSubMenu' href='http://xzipguide.blogspot.com/search/label/Truyen%20cuoi?max-results=10'>&nbsp;&nbsp;&nbsp;Truyện cười&nbsp;&nbsp;</a> <img src='" + strLinkImg + "' /> <a class='aSubMenu' href='http://www.xzipguide.blogspot.com/search/label/Trinh%20tham?max-results=10'>&nbsp;&nbsp;&nbsp;Truyện trinh thám&nbsp;&nbsp;</a> <img src='" + strLinkImg + "' /><a class='aSubMenu' href='http://xzipguide.blogspot.com/search/label/Tieu%20pham?max-results=10'>&nbsp;&nbsp;&nbsp;Tiểu phẩm hài&nbsp;&nbsp;</a>";
document.getElementById("subMenu").style.marginLeft = "160px";
DelayId = id;
}


else if (id == 8) {
//menu7

document.getElementById("subMenu").innerHTML = "<a class='aSubMenu' href='http://xzipguide.blogspot.com/search/label/Chuyen%20la?max-results=10'>&nbsp;&nbsp;&nbsp;Chuyện lạ&nbsp;&nbsp;</a> <img src='" + strLinkImg + "' /> <a class='aSubMenu' href='http://www.xzipguide.blogspot.com/search/label/Dien%20anh?max-results=10'>&nbsp;&nbsp;&nbsp;Điện ảnh&nbsp;&nbsp;</a> <img src='" + strLinkImg + "' /><a class='aSubMenu' href='http://xzipguide.blogspot.com/search/label/Ngoi%20sao?max-results=10'>&nbsp;&nbsp;&nbsp;Ngôi sao&nbsp;&nbsp;</a><img src='" + strLinkImg + "' /><a class='aSubMenu' href='http://xzipguide.blogspot.com/search/label/Fiml?max-results=10'>&nbsp;&nbsp;&nbsp;Hậu trường&nbsp;&nbsp;</a>";
document.getElementById("subMenu").style.marginLeft = "210px";
DelayId = id;
}


else if (id == 9) {
//menu8

document.getElementById("subMenu").innerHTML = "<a class='aSubMenu' href='http://xzipguide.blogspot.com/search/label/Tin%20moi?max-results=10'>&nbsp;&nbsp;&nbsp;Tin mới&nbsp;&nbsp;</a> <img src='" + strLinkImg + "' /> <a class='aSubMenu' href='http://www.xzipguide.blogspot.com/search/label/Tin%20trong%20nuoc?max-results=10'>&nbsp;&nbsp;&nbsp;Tin trong nước&nbsp;&nbsp;</a> <img src='" + strLinkImg + "' /><a class='aSubMenu' href='http://xzipguide.blogspot.com/search/label/Tin%20the%20gioi?max-results=10'>&nbsp;&nbsp;&nbsp;Tin thế giới&nbsp;&nbsp;</a><img src='" + strLinkImg + "' /><a class='aSubMenu' href='http://xzipguide.blogspot.com/search/label/Tin%20CNTT?max-results=10'>&nbsp;&nbsp;&nbsp;Tin CNTT-Viễn thông&nbsp;&nbsp;</a>";
document.getElementById("subMenu").style.marginLeft = "220px";
DelayId = id;
}
    else {
        setFolderDefault();
    }
}


function menuActive() {
try{
    document.getElementById(FolderId).className = 'menuActive' + FolderId + '_' + FolderId;
    writeSubmenu(FolderId);
    }
    catch (err) {
        //document.getElementById(FolderId).className = 'menuActive1_1;
		document.getElementById("1").className = 'menuActive1_1';
        //writeSubmenu(FolderId);
    }
}

function changeStyle(id) {
    if (id == DelayId) {
        clearTimeout(t);
        clearTimeout(t1);
    }
    if (id != FolderId) {
		try
        {
			clearTimeout(t);
			//clearTimeout(t1);
			// if(DelayId!=null)
			//document.getElementById(DelayId).className = 'menuDefault'+DelayId;
			document.getElementById(FolderId).className = 'menuDefault' + FolderId;
			document.getElementById(id).className = 'menuActive' + id + '_' + id;
			writeSubmenu(id);
		}
        catch(err)
		{
			writeSubmenu(1);
        }
    }
    else {
        if (DelayId != null)
        document.getElementById(DelayId).className = 'menuDefault' + DelayId;
        document.getElementById(id).className = 'menuActive' + id + '_' + id;
        writeSubmenu(id);
    }
}
function reChangeStyle(id) {
    if (id != FolderId) {
        t1 = setTimeout('clearMenu(' + id + ')', 10);
        t = setTimeout('menuActive()', 100);
    }
}
function clearMenu(id) {
    try {
        document.getElementById(id).className = 'menuDefault' + id;
    }
    catch (Error) {
    }
}
//end javascript



